package com.nlscan.qdkit.ui.publico.util

import android.content.Context
import com.nlscan.qdkit.ui.publico.config.PublicoConfig
import com.quvii.qvlib.util.QvPermissionUtils

object PermissionUtil {

    fun location(context: Context, callback: QvPermissionUtils.CheckCallBack) {
        if (PublicoConfig.IS_FORBID_ACCESS_FINE_LOCATION) {
            QvPermissionUtils.requestPermission(
                context,
                object : QvPermissionUtils.SimpleRequestPermission(context) {
                    override fun onRequestPermissionSuccess() {
                        callback.onRequestSuccess()
                    }
                },
                "android.permission.ACCESS_COARSE_LOCATION"
            )
        } else {
            QvPermissionUtils.location(context, callback)
        }
    }


}